package com.lazy.controller;

import com.lazy.entity.BicycleType;
import com.lazy.service.BicycleTypeService;
import com.lazy.utils.RespBean;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("bicycleType")
public class BicycleTypeController {
    @Resource
    private BicycleTypeService bicycleTypeService;

    @PostMapping("/")
    public RespBean addBicycleType(@RequestBody BicycleType bicycleType){
        return bicycleTypeService.addBicycleType(bicycleType);
    }

    @GetMapping("/")
    public RespBean getAllBicycleType() {
        return bicycleTypeService.getAllBicycleType();
    }

    @DeleteMapping("/{id}")
    public RespBean deleteBicycleType(@PathVariable Integer id) {
        return bicycleTypeService.deleteBicycleType(id);
    }

    @PutMapping("/")
    public RespBean updateBicycleType(@RequestBody BicycleType bicycleType){
        return bicycleTypeService.updateBicycleType(bicycleType);
    }
}

